import React, { Component } from 'react'

type Props = {
    username: string,
    editusername: () => void
}

type State = {}

export default class Child extends Component<Props, State> {
    state = {}

    render() {
        return (
            <div>
                <p>子组件--{this.props.username}</p>
                <p>子组件--<button onClick={() => this.props.editusername()}>点击修改父组件的username</button></p>
            </div>
        )
    }
}